<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="${staticServer}/inc/style/main.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/page.css" />
<link rel="stylesheet" href="${staticServer}/css/struct_info.css" />
<script src="${staticServer}/inc/js/jquery.js"></script>
<script src="${staticServer}/inc/js/pageset.js"></script>
<script src="${staticServer}/inc/js/submitter.js"></script>
<script src="${staticServer}/inc/js/infopad.js?2.2"></script>

<link rel="stylesheet" href="${staticServer}/css/consultant_client.css" />
	
<link rel="stylesheet" href="${staticServer}/inc/style/date/datepicker.css" />
<script src="${staticServer}/inc/js/datepicker.js"></script>

<style>
#SWFUpload_0{
	margin-top: 70px;
    margin-left: -30px;
}
</style>
<script>


var add_Period = function(){
	var id = $("#id").val();
	 
	var date_of_entry = $("#date_of_entry").val();
	var post = $("#post").val();
	var handle_person = $("#handle_person").val();
	var date_of_regist = $("#date_of_regist").val();
	var login_name = $("#target").val();
	var department = $("#department").val();
    var center = $("#center").val();
	var beizhu = $("#beizhu").val();
	var good= $("#good").val();
	 
	 if(good==""){
		infopad.err("请输入物品");
		return;
	}
	
	if(login_name==""){
		infopad.err("姓名");
		return;
	}
	
	$.post("${contextPath}/recruitment/addGoodProvide.json", {
		    "id":id,
		    "date_of_entry":date_of_entry,
		    "post":post,
		    "center":center,
		    "handle_person":handle_person,
		    "date_of_regist":date_of_regist,
		    "login_name":login_name,
		    "department":department,
		    "beizhu":beizhu,
		    "good":good
		}, function(ms) {
		   var msg = ms.msg;
		   if(msg!=null && msg=="1"){
			   infopad.msg("操作成功！");
			   window.location.href="${contextPath}/recruitment/good_provide_list.htm";
		   }
			
	});
}
$(function(){
	$("#sy_user").keyup(function(){
		var nickname = $("#sy_user").val();
		$("#b").prop( "checked", false );
		$("#c").prop( "checked", false );
		$("#d").prop( "checked", false );
		$("#e").prop( "checked", false );
		$("#f").prop( "checked", false );
		$("#j").prop( "checked", false );
		$("#h").prop( "checked", false );
		$("#i").prop( "checked", false );
		$("#j").prop( "checked", false );
		$("#k").prop( "checked", false );
		
		$.post("${contextPath}/index/getUserByNickname.json", {
			"nickname" : nickname
		}, function(ms) {
			 if(ms.user!=null){
			 	var userna = ms.user.username;
				$("#teacher").val(ms.user.nickname);
			 }
			
		});
	});
});

$(function(){
	$("#center").change(function(){
		var center = $("#center").val();
	    $.post("${contextPath}/recruitment/getTeacherByCenter.json", {
	    	"center" : center
		}, function(ms) {
	    	var list = ms.ulist;
	    	var objHtml="";
	    	$("#student").val("");
	    	for(var i=0;i<list.length;i++){
	    		objHtml +='<option value="'+list[i].nickname+'">'+list[i].nickname+'</option>';
	    	}
	    	$("#teacher").html(objHtml);
	    });

	})
});



</script>
</head>
<input type="hidden" id="id" value="<#if goodProvide??>${goodProvide.id}</#if>">
<body>
	<div id="home_link">
		<ul>
			<li></li>
			<li>&gt;</li>
			<li>组织架构</li>
			<li>&gt;</li>
			<li class="current">title</li>
		</ul>
	</div>

	<div id="container">
		<div id="title">添加物品反馈情况</div>
		<table id="infotable">
			<tr>
			  	 <th>中心:</th>
				<td>
					<select id="center" >
					<option value="<#if goodProvide??>${goodProvide.center}</#if>"><#if goodProvide??>${goodProvide.center}</#if></option>
	            		<#if office_List??>
	              			<#list office_List as ls>
	              				<option value="${ls.name}">${ls.name}</option>
	              			</#list>
	            		</#if>
	            	</select>	
				</td>
				<th>入司日期:</th>
				<td>
					<input type="text" id="date_of_entry" value="<#if goodProvide??>${goodProvide.date_of_entry}</#if>" rel="DATE::Y-m-d" value="" size="14" maxlength="15" readonly="readonly" class="DatePicker_Icon">
				</td>
			  	
			   
			   
			</tr>
		    <tr>
		      
		      <th>姓名:</th>
				<td>
				<select id="teacher" >
				<option value="<#if goodProvide??>${goodProvide.login_name}</#if>"><#if goodProvide??>${goodProvide.username}</#if></option>
	            		<#if ulist??>
	              			<#list ulist as ls>
	              				<option value="${ls.username}">${ls.nickname}</option>
	              			</#list>
	            		</#if>
	            </select>	
	             <input id="sy_user" type="text" value="" placeholder="快速搜索" />
	            </td>
				
		       
		        <th>登记日期:</th>
				<td>
					<input type="text" id="date_of_regist" value="<#if goodProvide??>${goodProvide.date_of_regist}</#if>" rel="DATE::Y-m-d" value="" size="14" maxlength="15" readonly="readonly" class="DatePicker_Icon">
				</td>
			 
			    
			</tr>
			<tr>
			
			   <th>职位:</th>
				<td><input id="post" type="text" value="<#if goodProvide??>${goodProvide.post}</#if>" size="30" maxlength="30" /></td>
				
				 <th>经手老师:</th>
				<td><input id="handle_person" type="text" value="<#if goodProvide??>${goodProvide.handle_person}</#if>" size="30" maxlength="30" /></td>
				
				
			</tr>
			<tr>
			<th>备注:</th>
				<td>
				    <textarea name="beizhu" id="beizhu" rows="5" cols="30" value="<#if goodProvide??>${goodProvide.beizhu}</#if>"><#if goodProvide??>${goodProvide.beizhu}</#if></textarea>
				</td>
			<th>发放物品:</th>
			<td>
				<textarea name="good" id="good" rows="5" cols="30" value="<#if goodProvide??>${goodProvide.good}</#if>"><#if goodProvide??>${goodProvide.beizhu}</#if></textarea>
			</td>
			</tr>
			
		</table>
		
		<div id="controlbar">
			<input type="button" class="submit" onclick="add_Period()" value="  保  存  " />
		</div>
	</div>
	
</body>
</html>